package edu.gatech.cc.liam.core.rl.models.stochasticgame;

public class StochasticGame<StateType> {
	public RewardFunction<StateType> RewardFunction;
	public DiscreteActionTransitionFunction<StateType> TransitionFunction;
	public String name;
	
	public StochasticGame(DiscreteActionTransitionFunction<StateType> transitionFunction, RewardFunction<StateType> rewardFunction) {
		super();
		RewardFunction = rewardFunction;
		TransitionFunction = transitionFunction;
		name = transitionFunction.getNumberOfPlayers() + " players with states: " + transitionFunction.getStates() + " " + transitionFunction.toString();
	}

	public StochasticGame(DiscreteActionTransitionFunction<StateType> transitionFunction, RewardFunction<StateType> rewardFunction,
			String name) {
		this(transitionFunction, rewardFunction);
		this.name = name;
	}
	
	public int getNumPlayers() {
		return this.TransitionFunction.getNumberOfPlayers();
	}
	
	@Override
	public String toString() {
		String rStr = "\n";
		rStr += "Game: " + name + "\n";
		rStr += "Transition Function:\n" + TransitionFunction.toString() + "\n";
		rStr += "Reward Function:\n" + RewardFunction.toString() + "\n";
		return rStr;
	}
}
